package com.onileVideo.content.model.dto;

import com.onileVideo.content.model.po.CourseCategory;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 马园博
 * @date 2023/06/04/01:35
 * @Project xczx 封装分类结果
 **/
@Data
@NoArgsConstructor
@ToString
@AllArgsConstructor
public class CategoryDto extends CourseCategory{
    private List<CategoryDto> childrenTreeNodes;

    public void addChildren(CategoryDto categoryDto){
        if(this.childrenTreeNodes == null){
            this.childrenTreeNodes = new ArrayList<>();
        }
        this.childrenTreeNodes.add(categoryDto);
    }
}
